﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// BienLaiThuChiTiet Repository. Good example of CRUD operations.
    ///// </summary>
    public class BienLaiThuChiTietRepository : IBienLaiThuChiTietRepository
    {
        private static readonly IBienLaiThuChiTietDao _bienLaiThuChiTiet = DataAccess.BienLaiThuChiTietDao;

        public List<BienLaiThuChiTiet> GetList()
        {
            return _bienLaiThuChiTiet.GetBienLaiThuChiTiet().ToList();
        }

        public BienLaiThuChiTiet Get(string id)
        {
            return _bienLaiThuChiTiet.GetBienLaiThuChiTietByID(id);
        }

        public void Insert(BienLaiThuChiTiet t)
        {
            _bienLaiThuChiTiet.InsertBienLaiThuChiTiet(t);
        }

        public void Update(BienLaiThuChiTiet t)
        {
            _bienLaiThuChiTiet.UpdateBienLaiThuChiTiet(t);
        }

        public void Delete(BienLaiThuChiTiet t)
        {
            _bienLaiThuChiTiet.DeleteBienLaiThuChiTiet(t);
        }

        public List<BienLaiThuChiTiet> GetBienLaiThuChiTietByBienLaiThuID(int BienLaiThuID)
        {
          return  _bienLaiThuChiTiet.GetBienLaiThuChiTietByBienLaiThuID(BienLaiThuID);
        }
    }
}